package com.deke.stat.service.impl;

import com.deke.entity.EduSubject02;
import com.deke.stat.dao.EduCourseDao;
import com.deke.stat.dao.StatisticsDao;
import com.deke.stat.service.StatisticsService;
import com.deke.stat.vo.StatisticsVo;
import com.deke.stat.vo.SubjectVo;
import com.deke.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：陈昂（731712841@qq.com）
 * @date ：Created in 2022/12/8 12:06
 * @description：
 * @modified By：
 * @version:
 */
@Service
public class StatisticsServiceImpl implements StatisticsService {
    @Autowired
    private StatisticsDao statisticsDao;
    @Autowired
    private EduCourseDao eduCourseDao;
    // 返回学生总数
    @Override
    public List<Integer> selectCountStudent() {
        return statisticsDao.selectCountStudent();
    }
    // 返回讲师总数
    @Override
    public List<Integer> selectCountTeachers() {
        return statisticsDao.selectCountTeachers();
    }
    // 课程分类
    @Override
    public Result<List<EduSubject02>> selectQueryAll(StatisticsVo statisticsVo) {
        List<EduSubject02> eduSubjects = statisticsDao.selectQueryAll(statisticsVo);
        return new Result<>(2000," ",eduSubjects);
    }
    // 课程销售
    @Override
    public Result<List<EduSubject02>> courseSales(StatisticsVo statisticsVo) {
        System.err.println(statisticsVo);
        List<SubjectVo> listResult = statisticsDao.courseSales(statisticsVo);
        return new Result(2000," ",listResult);
    }
}
